import { defineStore } from 'pinia'

const useUserInfoStore = defineStore("userInfo", {
    // 持久化存储插件其他配置
    state: () => ({
        openid: '',
        userInfo: {},
        token:''
    }),
    actions: {
        setToken(token){
            this.token = token
        },
        removeToken() {
            this.token = ''
        },
        setOpenid(openid){
            this.openid = openid
        },
        removeOpenid() {
            this.openid = ''
        },
        setUserInfo(data){
            this.userInfo = data
        },
        removeUserinfo(){
            this.userInfo = {}
        },
    },

    getters: {

    },
})

export default useUserInfoStore